//
//  MoreResultItemTableViewCell.m
//  CityFire
//
//  Created by  androidlongs on 2017/11/6.
//  Copyright © 2017年 刘养柱. All rights reserved.
//

#import "MoreResultItemTableViewCell.h"


@interface MoreResultItemTableViewCell()
@property (weak, nonatomic) IBOutlet UILabel *deviceNameLabel;

@property (weak, nonatomic) IBOutlet UILabel *deviceNumber;
@property (weak, nonatomic) IBOutlet UILabel *timeLabel;
@property (weak, nonatomic) IBOutlet UILabel *deviceSourceLabel;
@property (weak, nonatomic) IBOutlet UILabel *deviceStatueLabel;
@property (weak, nonatomic) IBOutlet UILabel *deviceContentLabel;

@end


@implementation MoreResultItemTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}


-(void)setModel:(MonitorModel *)model{
    _model = model;
    
    MonitorModel *monitorModel = model;
    self.deviceNameLabel.text = [NSString stringWithFormat:@"设备名称:%@",monitorModel.deviceName];
    self.deviceNumber.text = [NSString stringWithFormat:@"设备编号:%ld", monitorModel.deviceCode];
    //    [UIColor colorWithRed: / 255.0 green:/ 255.0 blue: / 255.0 alpha:1.0f]
    self.deviceStatueLabel.text = monitorModel.misinformation;
    self.deviceStatueLabel.textColor = [monitorModel.misinformation containsString:@"否"] ? [UIColor orangeColor] : [UIColor greenColor];
    self.deviceSourceLabel.text = [NSString stringWithFormat:@"来源：%@",monitorModel.record1];
    self.deviceContentLabel.text = [NSString stringWithFormat:@"内容：%@",monitorModel.record3];
    self.deviceStatueLabel.text = [NSString stringWithFormat:@"类型：%@",monitorModel.record2];
    NSString *str = [NSString stringWithFormat:@"%ld",monitorModel.timeHistory];
    NSString *breaktime = [NSString timeWithTimeIntervalString:str];
    self.timeLabel.text = [NSString stringWithFormat:@"时间：%@",breaktime];
    
    
}

@end
